package com.platform.server.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.platform.server.entity.EnterpriseInfo;
import com.platform.server.entity.OrderSend;
import com.platform.server.entity.ServerOrder;
import com.platform.server.service.EnterpriseService;

@Controller
@RequestMapping("/enterprise")
public class EnterpriseController {

		@Autowired
		private EnterpriseService enterpriseService;
		/**
		 *  员工申请加入企业
		 * @param enterpriseInfo
		 * @return
		 */
	  	@ResponseBody
	    @RequestMapping(value = "/addEnterprise", method = RequestMethod.POST)
	    public Object addEnterprise(EnterpriseInfo enterpriseInfo) {
	        return enterpriseService.addEnterpriseInfo(enterpriseInfo);
	    }
	  	
		/**
		 *  查询企业报名的需求
		 * @param enterpriseInfo
		 * @return
		 */
	  	@ResponseBody
	    @RequestMapping(value = "/selectEnterpriseSignUp", method = RequestMethod.POST)
	    public Object selectEnterpriseInfoSignUp(EnterpriseInfo enterpriseInfo) {
	        return enterpriseService.selectEnterpriseInfoSignUp(enterpriseInfo);
	    }
	  	
	  	 /**
	     * 查询企业的员工
	     */
	  	@ResponseBody
	    @RequestMapping(value = "/selectEnterpriseStaff", method = RequestMethod.POST)
	    public Object selectEnterpriseStaffList(ServerOrder serverOrder) {
	        return enterpriseService.selectEnterpriseStaffList(serverOrder);
	    }
	  	
	  	 /**
	     * 企业给员工派单
	     */
	  	@ResponseBody
	    @RequestMapping(value = "/EnterpriseOrderSend", method = RequestMethod.POST)
	    public Object EnterpriseOrderSend(OrderSend orderSend) {
	        return enterpriseService.addEnterpriseOrderSend(orderSend);
	    }
	    /**
		    * 改派/强制接受/申请改派
		    */
	  	@ResponseBody
	    @RequestMapping(value = "/updateOrderSend", method = RequestMethod.POST)
	    public Object updateOrderSend(OrderSend orderSend) {
	        return enterpriseService.updateOrderSend(orderSend);
	    }
	  	
	  	 /**
		  * 查询员工订单列表
		  */
	  	@ResponseBody
	    @RequestMapping(value = "/selectOrderSendList", method = RequestMethod.POST)
	    public Object selectOrderSendList(OrderSend orderSend) {
	        return enterpriseService.selectOrderSendList(orderSend);
	    }
	  	 /**
		    * 查询企业服务列表
		    */
	  	@ResponseBody
	    @RequestMapping(value = "/selectEnterpriseServer", method = RequestMethod.POST)
	    public Object selectEnterpriseServerList(OrderSend orderSend) {
	        return enterpriseService.selectEnterpriseServerList(orderSend);
	    }
	  	
		 /**
		    * 根据手机号新增员工
		    */
	  	@ResponseBody
	    @RequestMapping(value = "/addEnterpriseUser", method = RequestMethod.POST)
	    public Object addEnterpriseUser(String mobile, String enterprise_user) {
	        return enterpriseService.addEnterpriseUser(mobile,enterprise_user);
	    }
		 /**
		    * 员工同意加入企业
		    */
	  	@ResponseBody
	    @RequestMapping(value = "/addUserEnterprise", method = RequestMethod.POST)
	    public Object addUserEnterprise(String user_id, String enterprise_id,String msgId,String audit) {
	        return enterpriseService.addUserEnterprise( user_id,  enterprise_id,msgId,audit);
	    }
	  	 /**
		    * 同意、拒绝
		    */
	  	@ResponseBody
	    @RequestMapping(value = "/updateEnterpriseUser", method = RequestMethod.POST)
	    public Object updateEnterpriseUser(EnterpriseInfo enterpriseInfo) {
	        return enterpriseService.updateEnterpriseUser( enterpriseInfo);
	    }
	  	 /**
		    * 辞退
		    */
	  	@ResponseBody
	    @RequestMapping(value = "/deleteEnterpriseUser", method = RequestMethod.POST)
	    public Object deleteEnterpriseUser(EnterpriseInfo enterpriseInfo) {
	        return enterpriseService.deleteEnterpriseUser( enterpriseInfo);
	    }
		 /**
		    * 查询企业员工申请列表
		    */
	  	@ResponseBody
	    @RequestMapping(value = "/selectEnterpriseUserList", method = RequestMethod.POST)
	    public Object selectEnterpriseUserList(EnterpriseInfo enterpriseInfo) {
	        return enterpriseService.selectEnterpriseUserList( enterpriseInfo);
	    }
}
